<%--
  Created by IntelliJ IDEA.
  User: yang
  Date: 2020/10/18
  Time: 17:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="..${pageContext.request.contextPath }/res/css/selectInformation.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/res/css/checkIn.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/res/css/checkOut.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath }/res/css/myOrder.css">
    <!-- <style>
        [v-cloak] {
          display:none;
        };
      </style> -->
</head>
<body class="bodyType">
<div class="title">
    <samp>用户信息上传</samp>
</div>
<div style="width: 1000px;"  id="download">
    <div class="total">
        <div class="checkInTitel">
            模板下载
        </div>
        <hr style="color: #f1f1f1; width: 100%;">
        <div class="userCondition">
            <a href="${pageContext.request.contextPath}/res/template/user.xlsx">下载模板（Excel 2007以上版本）</a>
        </div>
    </div>
    <div class="total">
        <div class="checkInTitel">
            信息上传
        </div>
        <hr style="color: #f1f1f1; width: 100%;">
        <div class="userCondition">
            <input style="height: 35px; font-size: 20px; line-height: 35px;" type="file" name="excel" id="excel">
            <input type="button" style="height: 35px; font-size: 20px;width: 70px; " id="up-btn" value="上传">
            <p id ="result"></p>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath }/res/js/jquery.js"></script>
<script src="${pageContext.request.contextPath }/res/js/ajaxfileupload.js"></script>
<script type="text/javascript">
    $("#up-btn").click(function(){
        $.ajaxFileUpload({
            url:'upload_user_information',
            type:'POST',
            secureuri: false,
            fileElementId:'excel',
            dataType:'json',
            async:false,
            success:function(res){
                $("#result").html("Ok!");
            },
            error:function(){
                alert("Oops... Something Error....")
            }
        })
    });
</script>
</body>
</html>
